<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";
</style>
<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			uni.getProvider({
				service: 'oauth',
				success: function(res) {
					uni.setStorageSync('provider', res.provider[0])
				}
			})
			uni.login({
				success: (res) => {
					console.log(res.code);
					if (res.code) {
						uni.request({
							url: 'https://wesl.nekolab.tech/sp/v1/login/login',
							method: 'POST',
							header: {
								'Content-Type': 'application/x-www-form-urlencoded'
							},
							data: {
								code: res.code
							},
							success: (suc) => {
								console.log("suc.data.data.token==" + suc.data.data.token)
								uni.setStorage({
									key: 'token',
									data: suc.data.data.token,
									success: function() {
										console.log('success');
									}
								});
							}
						})
					}
				}
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	page {
		background-color: #f8f8f8;
	}

	/*每个页面公共css */
</style>
